function checkSub(){
	
	if(document.getElementById('trade_id').value==''){
		alert('');
		document.getElementById('trade_id').focus();
		return false;
	}
	
	if(document.getElementById('info_id').value==''){
		alert('');
		document.getElementById('info_id').focus();
		return false;
	}
	
	if(document.getElementById('trade_state').value==''){
		alert('');
		document.getElementById('trade_state').focus();
		return false;
	}
	
	if(document.getElementById('cust_id').value==''){
		alert('');
		document.getElementById('cust_id').focus();
		return false;
	}
	
	if(document.getElementById('user_id').value==''){
		alert('');
		document.getElementById('user_id').focus();
		return false;
	}
	
	if(document.getElementById('content').value==''){
		alert('');
		document.getElementById('content').focus();
		return false;
	}
	
	if(document.getElementById('in_date').value==''){
		alert('');
		document.getElementById('in_date').focus();
		return false;
	}
	
	document.addForm.submit();
}

function search(){
	//TODO
	

   var start_attr=""; 
  if(document.getElementById("startprovince").value!="")
  {
      start_attr = document.getElementById("startprovince").value+"|"; 
  }

  if(document.getElementById("starteparchy_code").value!="")
  {
      start_attr += document.getElementById("starteparchy_code").value+"|"; 
  }

  if(document.getElementById("startcity_code").value!="")
  {
      start_attr += document.getElementById("startcity_code").value+"|"; 
  }
  
  var end_attr=""; 
  if(document.getElementById("endprovince").value!="")
  {
      end_attr = document.getElementById("endprovince").value+"|"; 
  }

  if(document.getElementById("endeparchy_code").value!="")
  {
      end_attr += document.getElementById("endeparchy_code").value+"|"; 
  }

  if(document.getElementById("endcity_code").value!="")
  {
      end_attr += document.getElementById("endcity_code").value+"|"; 
  }
  
  document.getElementById("s_end_addr").value = end_attr;
  document.getElementById("s_start_addr").value = start_attr;

  
	document.indexForm.submit();
}
